package com.demo.supplier.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 供应商创建/更新DTO
 * 
 * @author demo
 */
@Data
@ApiModel("供应商创建/更新DTO")
public class SupplierDto {

    @ApiModelProperty("供应商ID（更新时需要）")
    private Long id;

    @ApiModelProperty(value = "供应商编码", required = true)
    @NotBlank(message = "供应商编码不能为空")
    @Size(max = 50, message = "供应商编码长度不能超过50个字符")
    private String supplierCode;

    @ApiModelProperty(value = "供应商名称", required = true)
    @NotBlank(message = "供应商名称不能为空")
    @Size(max = 200, message = "供应商名称长度不能超过200个字符")
    private String supplierName;

    @ApiModelProperty("联系人")
    @Size(max = 50, message = "联系人长度不能超过50个字符")
    private String contactPerson;

    @ApiModelProperty("联系电话")
    @Pattern(regexp = "^1[3-9]\\d{9}$|^0\\d{2,3}-?\\d{7,8}$", message = "联系电话格式不正确")
    private String contactPhone;

    @ApiModelProperty("联系邮箱")
    @Email(message = "邮箱格式不正确")
    @Size(max = 100, message = "邮箱长度不能超过100个字符")
    private String contactEmail;

    @ApiModelProperty("地址")
    @Size(max = 500, message = "地址长度不能超过500个字符")
    private String address;

    @ApiModelProperty("营业执照号")
    @Size(max = 100, message = "营业执照号长度不能超过100个字符")
    private String businessLicense;

    @ApiModelProperty("信用等级")
    @Size(max = 10, message = "信用等级长度不能超过10个字符")
    private String creditRating;

    @ApiModelProperty("状态：1=启用，0=禁用")
    private Integer status;

    @ApiModelProperty("Logo文件ID")
    private Long logoFileId;

    @ApiModelProperty("营业执照文件ID")
    private Long licenseFileId;

    @ApiModelProperty("资质证书文件ID")
    private Long certificateFileId;

    @ApiModelProperty("Logo图片URL")
    private String logoUrl;

    @ApiModelProperty("描述")
    private String description;
}